package com.chanta.server.persistence;

import java.util.Date;
import java.util.Set;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

/**
 * 
 * TODO Please comment this class..
 * 
 * @author Hakan Özdemir - Vendoo Inc.
 * @date 03.11.2013
 * 
 */
@PersistenceCapable
public class Field {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;

	@Persistent
	private Fieldtype fieldtype;

	@Persistent
	private String fieldname;

	@Persistent
	private String validation;

	@Persistent
	private Date creationDate;

	@Persistent
	private String status;

	/** do not rename */
	@Persistent
	private Portal portal;

	@Persistent
	private Set<Template> templates;

	/**
	 * Getter for fieldtype.
	 * 
	 * @return fieldtype
	 */
	public Fieldtype getFieldtype() {
		return fieldtype;
	}

	/**
	 * Setter for fieldtype.
	 * 
	 * @param fieldtype
	 *            the fieldtype to set
	 */
	public void setFieldtype(Fieldtype fieldtype) {
		this.fieldtype = fieldtype;
	}

	/**
	 * Getter for fieldname.
	 * 
	 * @return fieldname
	 */
	public String getFieldname() {
		return fieldname;
	}

	/**
	 * Setter for fieldname.
	 * 
	 * @param fieldname
	 *            the fieldname to set
	 */
	public void setFieldname(String fieldname) {
		this.fieldname = fieldname;
	}

	/**
	 * Getter for validation.
	 * 
	 * @return validation
	 */
	public String getValidation() {
		return validation;
	}

	/**
	 * Setter for validation.
	 * 
	 * @param validation
	 *            the validation to set
	 */
	public void setValidation(String validation) {
		this.validation = validation;
	}

	/**
	 * Getter for creationDate.
	 * 
	 * @return creationDate
	 */
	public Date getCreationDate() {
		return creationDate;
	}

	/**
	 * Setter for creationDate.
	 * 
	 * @param creationDate
	 *            the creationDate to set
	 */
	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	/**
	 * Getter for status.
	 * 
	 * @return status
	 */
	public String getStatus() {
		return status;
	}

	/**
	 * Setter for status.
	 * 
	 * @param status
	 *            the status to set
	 */
	public void setStatus(String status) {
		this.status = status;
	}

	/**
	 * Getter for portal.
	 * 
	 * @return portal
	 */
	public Portal getPortal() {
		return portal;
	}

	/**
	 * Setter for portal.
	 * 
	 * @param portal
	 *            the portal to set
	 */
	public void setPortal(Portal portal) {
		this.portal = portal;
	}

	/**
	 * Getter for templates.
	 * 
	 * @return templates
	 */
	public Set<Template> getTemplates() {
		return templates;
	}

	/**
	 * Setter for templates.
	 * 
	 * @param templates
	 *            the templates to set
	 */
	public void setTemplates(Set<Template> templates) {
		this.templates = templates;
	}
}
